package com.yanqu.xiuxian.crosssystem.manger.elementalbonds.entity;

import com.yanqu.xiuxian.config.elementalbonds.enums.ElementalBondsEffectType;
import com.yanqu.xiuxian.crosssystem.manger.elementalbonds.enums.ElementalBondsCardType;
import com.yanqu.xiuxian.crosssystem.manger.elementalbonds.enums.ElementalBondsSkillType;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class ElementalBondsOperateEffect {

    private int effectType;                             // 基础类型EffectType，或者技能ID后面加2位数字（00表示技能结束，01、02...表示技能的每个过程）
    private List<ElementalBondsBlock> elementalBondsBlockList;
    private int param;

    public ElementalBondsOperateEffect(ElementalBondsEffectType elementalBondsEffectType) {
        this.effectType = elementalBondsEffectType.getType();
        this.elementalBondsBlockList = new ArrayList<>();
    }

    public ElementalBondsOperateEffect(ElementalBondsEffectType elementalBondsEffectType, List<ElementalBondsBlock> elementalBondsBlockList) {
        this.effectType = elementalBondsEffectType.getType();
        this.elementalBondsBlockList = elementalBondsBlockList;
    }

    public ElementalBondsOperateEffect(ElementalBondsCardType elementalBondsCardType, int no) {
        this.effectType = elementalBondsCardType.getType() * 100 + no;
        this.elementalBondsBlockList = new ArrayList<>();
    }

    public ElementalBondsOperateEffect(ElementalBondsCardType elementalBondsCardType, int no, ElementalBondsBlock elementalBondsBlock) {
        this.effectType = elementalBondsCardType.getType() * 100 + no;
        this.elementalBondsBlockList = Collections.singletonList(elementalBondsBlock);
    }

    public ElementalBondsOperateEffect(ElementalBondsCardType elementalBondsCardType, int no, List<ElementalBondsBlock> elementalBondsBlockList) {
        this.effectType = elementalBondsCardType.getType() * 100 + no;
        this.elementalBondsBlockList = elementalBondsBlockList;
    }

    public ElementalBondsOperateEffect(ElementalBondsCardType elementalBondsCardType, int no, List<ElementalBondsBlock> elementalBondsBlockList, int param) {
        this.effectType = elementalBondsCardType.getType() * 100 + no;
        this.elementalBondsBlockList = elementalBondsBlockList;
        this.param = param;
    }

    public ElementalBondsOperateEffect(ElementalBondsSkillType elementalBondsSkillType, int no) {
        this.effectType = elementalBondsSkillType.getType() * 100 + no;
        this.elementalBondsBlockList = new ArrayList<>();
    }

    public ElementalBondsOperateEffect(ElementalBondsSkillType elementalBondsSkillType, int no, List<ElementalBondsBlock> elementalBondsBlockList) {
        this.effectType = elementalBondsSkillType.getType() * 100 + no;
        this.elementalBondsBlockList = elementalBondsBlockList;
    }

    public ElementalBondsOperateEffect(ElementalBondsSkillType elementalBondsSkillType, int no, List<ElementalBondsBlock> elementalBondsBlockList, int param) {
        this.effectType = elementalBondsSkillType.getType() * 100 + no;
        this.elementalBondsBlockList = elementalBondsBlockList;
        this.param = param;
    }

    public void addElementalBondsBlock(ElementalBondsBlock elementalBondsBlock) {
        this.elementalBondsBlockList.add(elementalBondsBlock);
    }

    public int getEffectType() {
        return effectType;
    }

    public void setEffectType(int effectType) {
        this.effectType = effectType;
    }

    public List<ElementalBondsBlock> getBlockList() {
        return elementalBondsBlockList;
    }

    public void setBlockList(List<ElementalBondsBlock> elementalBondsBlockList) {
        this.elementalBondsBlockList = elementalBondsBlockList;
    }

    public int getParam() {
        return param;
    }

    public void setParam(int param) {
        this.param = param;
    }

}
